<?php
declare (strict_types = 1);

use vinchan\encryption\Kernel\FactoryInterface;


class AES implements FactoryInterface
{
	/**
	 * [被加密或被解密的数据]
	 * @var string
	 */
	private $data = "";

	/**
	 * [加密后或解密后的数据]
	 * @var string
	 */
	private $result = "";

	/**
	 * [加密/解密方式]
	 * @var string
	 */
	private $option = "";

	/**
	 * [密钥]
	 * @var string
	 */
	private $key = "";

	private $iv = "";

	public function __construct()
	{

	}

	/**
	 * [加密]
	 * @param  string $data [description]
	 * @return [type]       [description]
	 */
	public function encrypt(string $data):string
	{
		return openssl_encrypt($data,$this->option,$this->key);
	}

	/**
	 * [解密]
	 * @param  string $data [description]
	 * @return [type]       [description]
	 */
	public function decrypt(string $data):string
	{

	}

	/**
	 * [注册自动加载方法]
	 * @param  [type] $method [description]
	 * @param  [type] $param  [description]
	 * @return [type]         [description]
	 */
	public function __call($method,$param)
	{
		$option = isset($param['0'])?$param['0']:"";
		$this->$method = $option;
		return $this;
	}
}